package com.len.controller;

import com.len.base.CurrentUser;
import com.len.core.shiro.Principal;
import com.len.entity.SysUser;
import com.len.mapper.addMapper;
import com.len.service.addService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/add")
public class addController {
    @Autowired
    private addService addServices;

    @RequestMapping("/get")
    @ResponseBody
    public List<SysUser> allGet(){
        CurrentUser principal = Principal.getPrincipal();
        String userId = principal.getId();
        return addServices.allGet();
    }
}
